"""
读取csv文件

Version: 0.1
Author: yuwl
Date：2024-4-07
"""

import csv

filename = 'example.csv'

try:
    with open(filename) as f:
        reader = csv.reader(f)
        data = list(reader)
except FileNotFoundError as e:
    print(f'无法打开文件：{e}')
else:
    for item in data:
        # 这里有三个占位符：%-30s, %-20s, %-10s
        print('%-30s%-20s%-10s' % (item[0], item[1], item[2]))